home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WPAGEDLG_HPP_INCLUDED
- #define _WPAGEDLG_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WCANVAS_HPP_INCLUDED
- # include "wcanvas.hpp"
- #endif
- #ifndef _WCOMDLG_HPP_INCLUDED
- # include "wcomdlg.hpp"
- #endif
- #ifndef _WPRTDATA_HPP_INCLUDED
- # include "wprtdata.hpp"
- #endif
-
- #undef GetPrinterData
- #undef SetPrinterData
- #if defined( _UNICODE )
- #define GetPrinterData GetPrinterDataW
- #define SetPrinterData SetPrinterDataW
- #else
- #define GetPrinterData GetPrinterDataA
- #define SetPrinterData SetPrinterDataA
- #endif
-
- struct WCMCLASS WPageMargins {
- WUInt leftMargin;
- WUInt topMargin;
- WUInt rightMargin;
- WUInt bottomMargin;
-
- WPageMargins();
- WPageMargins( WUInt l, WUInt t, WUInt r, WUInt b );
-
- ~WPageMargins();
- };
-
- // Styles
-
- typedef WULong WPageSetupDStyle;
-
- #define WPageDSDefaultMinMargins ((WPageSetupDStyle)0x00000000L)
- #define WPageDSMinMargins ((WPageSetupDStyle)0x00000001L)
- #define WPageDSMargins ((WPageSetupDStyle)0x00000002L)
- #define WPageDSInThousandthsOfInches ((WPageSetupDStyle)0x00000004L)
- #define WPageDSInHundredthsOfMillimeters ((WPageSetupDStyle)0x00000008L)
- #define WPageDSDisableMargins ((WPageSetupDStyle)0x00000010L)
- #define WPageDSDisablePrinter ((WPageSetupDStyle)0x00000020L)
- #define WPageDSNoWarning ((WPageSetupDStyle)0x00000080L)
- #define WPageDSDisableOrientation ((WPageSetupDStyle)0x00000100L)
- #define WPageDSReturnDefault ((WPageSetupDStyle)0x00000400L)
- #define WPageDSDisablePaper ((WPageSetupDStyle)0x00000200L)
- #define WPageDSShowHelp ((WPageSetupDStyle)0x00000800L)
- #define WPageDSDisablePagePainting ((WPageSetupDStyle)0x00080000L)
-
- //
- // WPageSetupDialog
- //
-
- class WCMCLASS WPageSetupDialog : public WCommonDialog {
- WDeclareSubclass( WPageSetupDialog, WCommonDialog );
-
- public:
- WPageSetupDialog();
-
- ~WPageSetupDialog();
-
- /*******************************************************
- * Properties
- *******************************************************/
-
- // MetricUnits
- //
- // If TRUE, metric units (hundredths of millimeters)
- // are used, otherwise imperial units (thousandths of
- // inches) are used. The default is based on the locale
- // settings for the current user.
-
- WBool GetMetricUnits() const;
- WBool SetMetricUnits( WBool metricUnits );
-
- // PageMargins
- //
- // Set/get the margins, in the current unit settings.
-
- WPageMargins GetPageMargins() const;
- WBool SetPageMargins( const WPageMargins & pageMargins );
-
- // MinPageMargins
- //
- // Set/get the minimal margins, in the current unit settings.
-
- WPageMargins GetPageMinMargins() const;
- WBool SetPageMinMargins( const WPageMargins & pageMargins );
-
- // PageSize
- //
- // Returns the size of the page, in the current unit
- // settings. Top and left are always 0.
-
- WRect GetPageSize() const;
-
- // PrinterData
- //
- // The data that defines which printer is chosen and
- // its current settings (landscape, etc.).
-
- WPrinterData GetPrinterData() const;
- WBool SetPrinterData( const WPrinterData & printerData );
-
- // Style
- //
- // Set the styles used by the print dialog. Note that
- // the WPageSetupDSEnableHook style will ALWAYS be enabled.
-
- WPageSetupDStyle GetStyle() const;
- WBool SetStyle( WPageSetupDStyle style );
-
- /*******************************************************
- * Methods
- *******************************************************/
-
- // ChangeStyle
- //
- // Use to turn a specific style on or off.
-
- WBool ChangeStyle( WPageSetupDStyle style, WBool on );
-
- // Prompt
- //
- // Display the dialog and wait for it to be dismissed.
- // The first form uses the current settings. The second
- // is a convenience function.
-
- WBool Prompt();
-
- WBool Prompt( WWindow * owner, const WChar * title );
-
- /************************************************************
- * Notifications
- ************************************************************/
-
- void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
-
- /************************************************************
- * Others
- ************************************************************/
-
- protected:
-
- virtual void *PackPD();
- virtual WBool UnpackPD( WBool ok );
-
- /************************************************************
- * Data members
- ************************************************************/
-
- protected:
-
- void * _pd;
- WPrinterData _printerData;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
-
- #endif // _WPAGEDLG_HPP_INCLUDED
-